{% extends 'base.html' %}
{% block title %}
    <title>首页</title>
{% endblock %}

{% block css %}
<style>
    .block1-recommend-title{
        border-bottom: 1px solid rgb(128, 128, 128);
    }
    .list-group{
        margin-top: 20px;
    }
    .block1-2{
        margin:70px 70px;
    }
    .block1-list{
        display: block;
        font-size: 12px;
        width: 180px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .block1-recommend-category{
        font-size: 12px;
        margin-right: 10px;
        color: #858585;
    }
    .block2-1-list{
        display: block;
        font-size: 11px;
        width: 200px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 5;
        margin:0;
    }
    .block2-1 ol{
        list-style-type:square;
        margin:35px 0 0 0;
        padding: 0;
    }
    .block2-2-ul{
        display: flex;
    }
    .block2-2-list{

        margin: 5px 30px;
    }
    .block2-2-list img{
       width: 110px;
       height: 150px;

    }
    .block2-2-list span{
        display: block;
        font-size: 14px;
        width: 90px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 5;
        margin:0;
        margin-top: 15px;
    }
    .block2-2{
        margin-left: 50px;
    }
</style>
{% endblock %}

{% block js %}
<script>

</script>
{% endblock %}

{% block body %}
    <div class="row">
        <div class="col-md-2 block1-1">
            <div>
                <div class="block1-recommend-title"><h3>本周强推</h3></div>
                <ul class="list-group">
                    {% for rb in rbs%}
                    <li class="block1-list list-group-item" style="border: none;"><span class="block1-recommend-category"><a href="#">[{{ rb.category }}]</a></span><a href="/detail/{{ rb.id }}">{{ rb }}</a></li>
                    {% endfor %}
                </ul>
            </div>
        </div>
        <div class="col-md-7 block1-2">

                <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
                      <!-- Indicators -->
                      <ul class="carousel-indicators">
                          {% for ads in adss %}
                          {% if forloop.first %}
                          <li data-target="#carousel-example-generic" data-slide-to="{{ forloop.counter0 }}" class="active"></li>
                          {% else %}
                          <li data-target="#carousel-example-generic" data-slide-to="{{ forloop.counter0 }}"></li>
                          {% endif %}
                          {% endfor %}


                      </ul>

                      <!-- Wrapper for slides -->
                      <div class="carousel-inner  block1-2-carousel" role="listbox">
                          {% for ads in adss %}
                          {% if forloop.first %}
                          <div class="item active">
                          {% else %}
                          <div class="item">
                          {% endif %}
                              <img src="/media/{{ ads.img }}" alt="...">
                              <div class="carousel-caption">
                                  {{ ads.title }}
                              </div>
                            </div>
                          {% endfor %}
                      </div>

                      <!-- Controls -->
                      <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
                        <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                        <span class="sr-only">Previous</span>
                      </a>
                      <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
                        <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                        <span class="sr-only">Next</span>
                      </a>
                </div>
            </div>
        </div>
        <div class="col-md-2 block2-1">
            <div>
                <div class="block2-1-recommend-title"><h3>最新动态</h3></div>
                <ol>
                    {% for rb in rbs%}
                    <li class="block2-1-list list-group-item" style="border: none;">{{ rb }}</li>
                    {% endfor %}
                </ol>
            </div>
        </div>
        <div class="col-md-7 block2-2">
            <div>
                <div class="block2-2-recommend-title"><h3>热门推荐</h3></div>
                <ul class="block2-2-ul list-group">
                    {% for rb2 in rbs2%}
                    <li class="block2-2-list list-group-item" style="border: none;">
                        <div>
                            <div><img src="/media/{{ rb2.image.image }}" alt=""></div>
                            <span><a href="">{{ rb2.title }}</a></span>
                            <span><a href="">{{ rb2.author.title }}</a></span>
                        </div>
                    </li>
                    {% endfor %}
                </ul>
            </div>
        </div>
        <div class="col-md-2">

        </div>
        <div class="col-md-7">

        </div>
        <div class="col-md-7">

        </div>
        <div class="col-md-2">

        </div>
    </div>
{% endblock %}